<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>将一个表拷贝到数组中</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.pg-copy-from.html">« pg_copy_from</a></li>
      <li style="float: right;"><a href="function.pg-dbname.html">pg_dbname »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.pgsql.html">PostgreSQL 函数</a></li>
    <li>将一个表拷贝到数组中</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.pg-copy-to" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">pg_copy_to</h1>
    <p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">pg_copy_to</span> &mdash; <span class="dc-title">
     将一个表拷贝到数组中
    </span></p>

   </div>
   <div class="refsect1 unknown-seealsp" id="refsect1-function.pg-copy-to-unknown-seealsp">
    <h3 class="title">说明</h3>
     <div class="methodsynopsis dc-description">
      <span class="methodname"><strong>pg_copy_to</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">resource</span> <code class="parameter">$connection</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$table_name</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$delimiter</code><span class="initializer"> = ?</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$null_as</code><span class="initializer"> = ?</span></span><br>): <span class="type">array</span></div>

    <p class="para rdfs-comment">
     <span class="function"><strong>pg_copy_to()</strong></span> 将一个表拷贝到数组中，该数组作为结果返回。它在内部使用了 <code class="literal">COPY FROM</code> SQL 命令来插入记录，并返回结果数组。如果失败则返回 <strong><code>false</code></strong>。
    </p>
    <p class="para">
     参见 <span class="function"><a href="function.pg-copy-from.html" class="function">pg_copy_from()</a></span>。
    </p>
   </div>

  </div></div></div></body></html>